home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 1.0 for Developers / QuickTime 1.0 for Developers.iso / Programming Stuff / Interfaces / Oldstyle C Interfaces / SeqGrab2.h < prev    next >
C/C++ Source or Header  |  1991-09-06  |  12KB  |  275 lines

  1. /*
  2.     File:        SeqGrab2.h
  3.  
  4.     Contains:    xxx put contents here xxx
  5.  
  6.     Written by:    xxx put writers here xxx
  7.  
  8.     Copyright:    © 1991 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     This file is used in these builds: Warhol
  11.  
  12.     Change History (most recent first):
  13.  
  14.         <11>      9/5/91    PH        add SGGetBufferInfo call
  15.         <10>      9/5/91    PH        sg channels now have their own type.
  16.          <9>      9/5/91    PH        add sg flags
  17.          <8>      9/2/91    PH        add altCompressBuffer stuff
  18.          <7>     8/29/91    PH        playAllData flag for Ken
  19.          <6>     8/28/91    PH        refCon slime
  20.          <5>     8/27/91    PH        severely changing VideoBottles
  21.          <4>     8/24/91    PH        SGGetDataRate interface was wrong
  22.          <3>     8/20/91    PH        adding one more routine + error codes
  23.          <2>     8/19/91    PH        another check in
  24.          <1>     8/16/91    PH        first checked in
  25.          <1>     8/16/91    PH        first checked in
  26.  
  27.     To Do:
  28. */
  29.  
  30. #ifndef _SeqGrab_
  31. #define _SeqGrab_
  32.  
  33.  
  34. #include "Components.h"
  35. #include "Image Compression.h"
  36. #include "Movies.h"
  37.  
  38. /*
  39.     General Sequence Grab stuff
  40. */
  41.  
  42. typedef ComponentInstance SeqGrabComponent;
  43.  
  44. typedef ComponentInstance SGChannel;
  45.  
  46. #define SeqGrabComponentType 'barg'
  47. #define SeqGrabChannelType 'sgch'
  48.  
  49. typedef enum {
  50.     seqGrabToDisk = 1,
  51.     seqGrabToMemory = 2,
  52.     seqGrabDontUseTempMemory = 4,
  53.     seqGrabAppendToFile = 8,
  54.     seqGrabDontAddMovieResource = 16
  55. } SeqGrabDataOutputEnum;
  56.  
  57. typedef enum {
  58.     seqGrabRecord = 1,
  59.     seqGrabPreview = 2,
  60.     seqGrabPlayDuringRecord = 4
  61. } SeqGrabUsageEnum;
  62.  
  63. typedef enum {
  64.     seqGrabHasBounds = 1,
  65.     seqGrabHasVolume = 2,
  66.     seqGrabHasDiscreteSamples = 4
  67. } SeqGrabChannelInfoEnum;
  68.  
  69. typedef struct seqGrabFrameInfo {
  70.     long        frameOffset;
  71.     long        frameTime;
  72.     long        frameSize;
  73.     SGChannel    frameChannel;
  74.     long        frameRefCon;
  75. } seqGrabFrameInfo;
  76.  
  77. pascal ComponentResult SGInitialize(SeqGrabComponent s) =                 {0x2f3c,0,1,0x7000,0xa82a};
  78.  
  79. pascal ComponentResult SGSetDataOutput(SeqGrabComponent s, FSSpec *movieFile, long whereFlags) =                 {0x2f3c,8,2,0x7000,0xa82a};
  80. pascal ComponentResult SGGetDataOutput(SeqGrabComponent s, FSSpec *movieFile, long *whereFlags) =                 {0x2f3c,8,3,0x7000,0xa82a};
  81.  
  82. pascal ComponentResult SGSetGWorld(SeqGrabComponent s, CGrafPtr gp, GDHandle gd) =                 {0x2f3c,8,4,0x7000,0xa82a};
  83. pascal ComponentResult SGGetGWorld(SeqGrabComponent s, CGrafPtr *gp, GDHandle *gd) =                 {0x2f3c,8,5,0x7000,0xa82a};
  84.  
  85. pascal ComponentResult SGNewChannel(SeqGrabComponent s, OSType channelType, SGChannel *ref) =                 {0x2f3c,8,6,0x7000,0xa82a};
  86. pascal ComponentResult SGDisposeChannel(SeqGrabComponent s, SGChannel c) =                 {0x2f3c,4,7,0x7000,0xa82a};
  87.  
  88. pascal ComponentResult SGStartPreview(SeqGrabComponent s) =                 {0x2f3c,0,16,0x7000,0xa82a};
  89. pascal ComponentResult SGStartRecord(SeqGrabComponent s) =                 {0x2f3c,0,17,0x7000,0xa82a};
  90. pascal ComponentResult SGIdle(SeqGrabComponent s) =                 {0x2f3c,0,18,0x7000,0xa82a};
  91. pascal ComponentResult SGStop(SeqGrabComponent s) =                 {0x2f3c,0,19,0x7000,0xa82a};
  92.  
  93. pascal ComponentResult SGPause(SeqGrabComponent s, Boolean pause) =                 {0x2f3c,2,20,0x7000,0xa82a};
  94.  
  95. pascal ComponentResult SGPrepare(SeqGrabComponent s, Boolean prepareForPreview, Boolean prepareForRecord) =                 {0x2f3c,4,21,0x7000,0xa82a};
  96. pascal ComponentResult SGRelease(SeqGrabComponent s) =                  {0x2f3c,0,22,0x7000,0xa82a};
  97.  
  98. pascal Movie SGGetMovie(SeqGrabComponent s) =                 {0x2f3c,0,23,0x7000,0xa82a};
  99.  
  100. pascal ComponentResult SGSetMaximumRecordTime(SeqGrabComponent s, unsigned long ticks) =                 {0x2f3c,4,24,0x7000,0xa82a};
  101. pascal ComponentResult SGGetMaximumRecordTime(SeqGrabComponent s, unsigned long *ticks) =                 {0x2f3c,4,25,0x7000,0xa82a};
  102.  
  103. pascal ComponentResult SGGetStorageSpaceRemaining(SeqGrabComponent s, unsigned long *bytes) =                 {0x2f3c,4,26,0x7000,0xa82a};
  104. pascal ComponentResult SGGetTimeRemaining(SeqGrabComponent s, long *ticksLeft) =                 {0x2f3c,4,27,0x7000,0xa82a};
  105.  
  106. #define grabPictOffScreen (1)
  107. pascal ComponentResult SGGrabPict(SeqGrabComponent s, PicHandle *p, const Rect *bounds,
  108.                 short offscreenDepth, long grabPictFlags) =                 {0x2f3c,14,28,0x7000,0xa82a};
  109.  
  110. pascal ComponentResult SGGetLastMovieResID(SeqGrabComponent s, short *resID) =                 {0x2f3c,4,29,0x7000,0xa82a};
  111.  
  112. #define sgFlagControlledGrab (1)
  113.  
  114. pascal ComponentResult SGSetFlags(SeqGrabComponent s, long sgFlags) =                 {0x2f3c,4,30,0x7000,0xa82a};
  115.  
  116. pascal ComponentResult SGGetFlags(SeqGrabComponent s, long *sgFlags) =                 {0x2f3c,4,31,0x7000,0xa82a};
  117.  
  118. #if 0
  119. pascal ComponentResult SGGrabMovie(SeqGrabComponent s, ....) =                 {0x2f3c,0,1,0x7000,0xa82a};
  120. #endif
  121.  
  122. /*
  123.     General Channel stuff
  124. */
  125. pascal ComponentResult SGSetChannelUsage(SGChannel c, long usage) =                 {0x2f3c,4,128,0x7000,0xa82a};
  126. pascal ComponentResult SGGetChannelUsage(SGChannel c, long *usage) =                 {0x2f3c,4,129,0x7000,0xa82a};
  127.  
  128. pascal ComponentResult SGSetChannelBounds(SGChannel c, const Rect *bounds) =                 {0x2f3c,4,130,0x7000,0xa82a};
  129. pascal ComponentResult SGGetChannelBounds(SGChannel c, Rect *bounds) =                 {0x2f3c,4,131,0x7000,0xa82a};
  130.  
  131. pascal ComponentResult SGSetChannelVolume(SGChannel c, short volume) =                 {0x2f3c,2,132,0x7000,0xa82a};
  132. pascal ComponentResult SGGetChannelVolume(SGChannel c, short *volume) =                 {0x2f3c,4,133,0x7000,0xa82a};
  133.  
  134. pascal ComponentResult SGGetChannelInfo(SGChannel c, long *channelInfo) =                 {0x2f3c,4,134,0x7000,0xa82a};
  135.  
  136. #define channelPlayNormal 0
  137. #define channelPlayFast 1
  138. #define channelPlayHighQuality 2
  139. #define channelPlayAllData 4
  140.  
  141. pascal ComponentResult SGSetChannelPlayFlags(SGChannel c, long playFlags) =                 {0x2f3c,4,135,0x7000,0xa82a};
  142. pascal ComponentResult SGGetChannelPlayFlags(SGChannel c, long *playFlags) =                 {0x2f3c,4,136,0x7000,0xa82a};
  143.  
  144. pascal ComponentResult SGSetChannelMaxFrames(SGChannel c, long frameCount) =                 {0x2f3c,4,137,0x7000,0xa82a};
  145. pascal ComponentResult SGGetChannelMaxFrames(SGChannel c, long *frameCount) =                 {0x2f3c,4,138,0x7000,0xa82a};
  146.  
  147. pascal ComponentResult SGSetChannelRefCon(SGChannel c, long refCon) =                 {0x2f3c,4,139,0x7000,0xa82a};
  148.  
  149. /*
  150.     Video stuff
  151. */
  152.  
  153. typedef struct SGCompressInfo {
  154.     Ptr                buffer;
  155.     unsigned long    bufferSize;
  156.     unsigned char    similarity;
  157.     unsigned char    reserved;
  158. } SGCompressInfo;
  159.  
  160. typedef pascal ComponentResult (*GrabProc)(SGChannel c, short bufferNum, long refCon);
  161. typedef pascal ComponentResult (*GrabCompleteProc)(SGChannel c, short bufferNum, Boolean *done, long refCon);
  162.  
  163. typedef pascal ComponentResult (*DisplayProc)(SGChannel c, short bufferNum, MatrixRecord *mp, RgnHandle clipRgn, long refCon);
  164.  
  165. typedef pascal ComponentResult (*CompressProc)(SGChannel c, short bufferNum, long refCon);
  166. typedef pascal ComponentResult (*CompressCompleteProc)(SGChannel c, short bufferNum,
  167.                                         Boolean *done, SGCompressInfo *ci, long refCon);
  168.  
  169. typedef pascal ComponentResult (*AddFrameProc)(SGChannel c, short bufferNum, TimeValue atTime, TimeScale scale,
  170.                             const SGCompressInfo *ci, long refCon);
  171.  
  172. typedef pascal ComponentResult (*TransferFrameProc)(SGChannel c, short bufferNum, MatrixRecord *mp, RgnHandle clipRgn, long refCon);
  173.  
  174. typedef struct VideoBottles {
  175.     short                    procCount;
  176.     GrabProc                grabProc;
  177.     GrabCompleteProc        grabCompleteProc;
  178.     DisplayProc                displayProc;
  179.     CompressProc            compressProc;
  180.     CompressCompleteProc    compressCompleteProc;
  181.     AddFrameProc            addFrameProc;
  182.     TransferFrameProc        transferFrameProc;
  183. } VideoBottles;
  184.  
  185. pascal ComponentResult SGGetSrcVideoBounds(SGChannel c, Rect *r) =                 {0x2f3c,4,256,0x7000,0xa82a};
  186. pascal ComponentResult SGSetVideoRect(SGChannel c, Rect *r) =                 {0x2f3c,4,257,0x7000,0xa82a};
  187. pascal ComponentResult SGGetVideoRect(SGChannel c, Rect *r) =                 {0x2f3c,4,258,0x7000,0xa82a};
  188.  
  189. pascal ComponentResult SGGetVideoCompressorType(SGChannel c, OSType *compressorType) =                 {0x2f3c,4,259,0x7000,0xa82a};
  190. pascal ComponentResult SGSetVideoCompressorType(SGChannel c, OSType compressorType) =                 {0x2f3c,4,260,0x7000,0xa82a};
  191.  
  192. pascal ComponentResult SGSetVideoCompressor(SGChannel c, short depth, CompressorComponent compressor,
  193.             CodecQ spatialQuality, CodecQ temporalQuality, long keyFrameRate) =                 {0x2f3c,18,261,0x7000,0xa82a};
  194. pascal ComponentResult SGGetVideoCompressor(SGChannel c, short *depth, CompressorComponent *compressor,
  195.             CodecQ *spatialQuality, CodecQ *temporalQuality, long *keyFrameRate) =                 {0x2f3c,20,262,0x7000,0xa82a};
  196.  
  197. pascal ComponentInstance SGGetVideoDigitizerComponent(SGChannel c) =                 {0x2f3c,0,263,0x7000,0xa82a};
  198. pascal ComponentResult SGSetVideoDigitizerComponent(SGChannel c, ComponentInstance vdig) =                 {0x2f3c,4,264,0x7000,0xa82a};
  199. pascal ComponentResult SGVideoDigitizerChanged(SGChannel c) =                 {0x2f3c,0,265,0x7000,0xa82a};
  200.  
  201. pascal ComponentResult SGSetVideoBottlenecks(SGChannel c, VideoBottles *vb) =                 {0x2f3c,4,266,0x7000,0xa82a};
  202. pascal ComponentResult SGGetVideoBottlenecks(SGChannel c, VideoBottles *vb) =                 {0x2f3c,4,267,0x7000,0xa82a};
  203.  
  204. pascal ComponentResult SGGrabFrame(SGChannel c, short bufferNum) =                 {0x2f3c,2,268,0x7000,0xa82a};
  205. pascal ComponentResult SGGrabFrameComplete(SGChannel c, short bufferNum, Boolean *done) =                 {0x2f3c,6,269,0x7000,0xa82a};
  206.  
  207. pascal ComponentResult SGDisplayFrame(SGChannel c, short bufferNum, MatrixRecord *mp, RgnHandle clipRgn) =                 {0x2f3c,10,270,0x7000,0xa82a};
  208.  
  209. pascal ComponentResult SGCompressFrame(SGChannel c, short bufferNum) =                 {0x2f3c,2,271,0x7000,0xa82a};
  210. pascal ComponentResult SGCompressFrameComplete(SGChannel c, short bufferNum, Boolean *done, SGCompressInfo *ci) =                 {0x2f3c,10,272,0x7000,0xa82a};
  211.  
  212. pascal ComponentResult SGAddFrame(SGChannel c, short bufferNum, TimeValue atTime, TimeScale scale, const SGCompressInfo *ci) =                 {0x2f3c,14,273,0x7000,0xa82a};
  213.  
  214. pascal ComponentResult SGTransferFrameForCompress(SGChannel c, short bufferNum, MatrixRecord *mp, RgnHandle clipRgn) =                 {0x2f3c,10,274,0x7000,0xa82a};
  215.  
  216. pascal ComponentResult SGSetCompressBuffer(SGChannel c, short depth, const Rect *compressSize) =                 {0x2f3c,6,279,0x7000,0xa82a};
  217.  
  218. pascal ComponentResult SGGetCompressBuffer(SGChannel c, short *depth, Rect *compressSize) =                 {0x2f3c,8,280,0x7000,0xa82a};
  219.  
  220. pascal ComponentResult SGGetBufferInfo(SGChannel c, short bufferNum, 
  221.                     PixMapHandle *bufferPM, Rect *bufferRect,
  222.                     GWorldPtr *compressBuffer, Rect *compressBufferRect) =                 {0x2f3c,18,281,0x7000,0xa82a};
  223.  
  224.  
  225.  
  226. /*
  227.     Sound stuff
  228. */
  229.  
  230. pascal ComponentResult SGSetSoundInputDriver(SGChannel c, Str255 driverName) =                 {0x2f3c,4,256,0x7000,0xa82a};
  231. pascal long SGGetSoundInputDriver(SGChannel c) =                 {0x2f3c,0,257,0x7000,0xa82a};
  232. pascal ComponentResult SGSoundInputDriverChanged(SGChannel c) =                 {0x2f3c,0,258,0x7000,0xa82a};
  233.  
  234. pascal ComponentResult SGSetSoundRecordChunkSize(SGChannel c, long seconds) =                 {0x2f3c,4,259,0x7000,0xa82a};
  235. pascal long SGGetSoundRecordChunkSize(SGChannel c) =                 {0x2f3c,0,260,0x7000,0xa82a};
  236.  
  237. pascal ComponentResult SGSetSoundInputRate(SGChannel c, Fixed rate) =                 {0x2f3c,4,261,0x7000,0xa82a};
  238. pascal Fixed SGGetSoundInputRate(SGChannel c) =                 {0x2f3c,0,262,0x7000,0xa82a};
  239.  
  240.  
  241. /*
  242.     calls from seqGrab to Channel
  243. */
  244.  
  245. pascal ComponentResult SGInitChannel(SGChannel c, SeqGrabComponent owner) =                 {0x2f3c,4,200,0x7000,0xa82a};
  246. pascal ComponentResult SGWriteSamples(SGChannel c, Movie m, AliasHandle theFile) =                 {0x2f3c,8,201,0x7000,0xa82a};
  247. pascal ComponentResult SGGetDataRate(SGChannel c, long *bytesPerSecond) =                 {0x2f3c,4,202,0x7000,0xa82a};
  248.  
  249.  
  250. /*
  251.     calls from Channel to seqGrab
  252. */
  253.  
  254. pascal ComponentResult SGWriteMovieData(SeqGrabComponent s, SGChannel c, Ptr p, long len, long *offset) =                 {0x2f3c,16,128,0x7000,0xa82a};
  255. pascal ComponentResult SGAddFrameReference(SeqGrabComponent s, seqGrabFrameInfo *frameInfo) =                 {0x2f3c,4,129,0x7000,0xa82a};
  256. pascal ComponentResult SGGetNextFrameReference(SeqGrabComponent s, seqGrabFrameInfo *frameInfo,
  257.                     TimeValue *frameDuration, long *frameNumber) =                 {0x2f3c,12,130,0x7000,0xa82a};
  258. pascal ComponentResult SGGetTimeBase(SeqGrabComponent s, TimeBase *tb) =                 {0x2f3c,4,131,0x7000,0xa82a};
  259.  
  260. enum {
  261.     noDeviceForChannel = -9400,
  262.     grabTimeComplete = -9401,
  263.     cantDoThatInCurrentMode = -9402,
  264.     notEnoughMemoryToGrab = -9403,
  265.     notEnoughDiskSpaceToGrab = -9404,
  266.     couldntGetRequiredComponent = -9405,
  267.     badSGChannel = -9406,
  268.     seqGrabInfoNotAvailable = -9407,
  269.     deviceCantMeetRequest = -9408
  270. };
  271.  
  272.  
  273.  
  274. #endif _SeqGrab_
  275.